package cn.kgc.mes.service.impl;

import java.util.List;
import cn.kgc.mes.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import cn.kgc.mes.mapper.CheckSubjectMapper;
import cn.kgc.mes.domain.CheckSubject;
import cn.kgc.mes.service.ICheckSubjectService;

/**
 * 点检项目Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-09-17
 */
@Service
public class CheckSubjectServiceImpl implements ICheckSubjectService 
{
    @Autowired
    private CheckSubjectMapper checkSubjectMapper;

    /**
     * 查询点检项目
     * 
     * @param recordId 点检项目主键
     * @return 点检项目
     */
    @Override
    public CheckSubject selectCheckSubjectByRecordId(Long recordId)
    {
        return checkSubjectMapper.selectCheckSubjectByRecordId(recordId);
    }

    /**
     * 查询点检项目列表
     * 
     * @param checkSubject 点检项目
     * @return 点检项目
     */
    @Override
    public List<CheckSubject> selectCheckSubjectList(CheckSubject checkSubject)
    {
        return checkSubjectMapper.selectCheckSubjectList(checkSubject);
    }

    /**
     * 新增点检项目
     * 
     * @param checkSubject 点检项目
     * @return 结果
     */
    @Override
    public int insertCheckSubject(CheckSubject checkSubject)
    {
        checkSubject.setCreateTime(DateUtils.getNowDate());
        return checkSubjectMapper.insertCheckSubject(checkSubject);
    }

    /**
     * 修改点检项目
     * 
     * @param checkSubject 点检项目
     * @return 结果
     */
    @Override
    public int updateCheckSubject(CheckSubject checkSubject)
    {
        checkSubject.setUpdateTime(DateUtils.getNowDate());
        return checkSubjectMapper.updateCheckSubject(checkSubject);
    }

    /**
     * 批量删除点检项目
     * 
     * @param recordIds 需要删除的点检项目主键
     * @return 结果
     */
    @Override
    public int deleteCheckSubjectByRecordIds(Long[] recordIds)
    {
        return checkSubjectMapper.deleteCheckSubjectByRecordIds(recordIds);
    }

    /**
     * 删除点检项目信息
     * 
     * @param recordId 点检项目主键
     * @return 结果
     */
    @Override
    public int deleteCheckSubjectByRecordId(Long recordId)
    {
        return checkSubjectMapper.deleteCheckSubjectByRecordId(recordId);
    }
}
